//
//  YWQrcodeManager.h
//  maintain
//
//  Created by Kyo on 16/3/16.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"
#import "QRCodeReaderViewController.h"
//@class QRCodeReaderViewController;
@class UIViewController;

typedef NS_ENUM(NSUInteger, YWQrcodeLogType) {
    YWQrcodeLogTypeAttendance = 2, //签到
    YWQrcodeLogTypeMeterReading = 3, //抄表
    YWQrcodeLogTypeMission = 4, //做任务
    YWQrcodeLogTypePatrolling = 5, //巡更
    YWQrcodeLogTypeEquipment = 0, //设备台账
};
typedef NS_ENUM(NSUInteger, YWQrcodeRequestStatu) {
    YWQrcodeRequestStatuSuccess = 1, //
    YWQrcodeRequestStatuNoData = 2,
    YWQrcodeRequestStatuFail = 3,
};
typedef NS_ENUM(NSUInteger, YWQrcodeScanType) {
    YWQrcodeScanTypeNomall = 1, //正常扫码
    YWQrcodeScanTypeMeterReading = 2,//抄表扫码
};

typedef void (^QRCodeReaderCompletionBlock)(NSString *qrcodeId, QRCodeReaderViewController *qrCodeReaderViewController);

@interface YWQrcodeManager : NSObject
YWSingletonH(Manager)

/**
 *  ewin二维码扫描
 *
 *  @return 结果
 */
- (void)clickScanButtonWithType:(YWQrcodeScanType)scanType ViewController:(UIViewController*)vieController completionBlock:(QRCodeReaderCompletionBlock)completionBlock;

/**
 *  物料二维码扫描
 *
 *  @return 结果
 */
- (void)clickMaterialScanWithType:(YWQrcodeScanType)scanType ViewController:(UIViewController*)vieController completionBlock:(QRCodeReaderCompletionBlock)completionBlock;

/**
 *  请求二维码列表信息
 *
 *  @param qrcodeId    二维码Id
 *
 *  @return 结果
 */
-(void)requestQrcodeDataWithQrcodeId:(NSString *)qrcodeId WithComplete:(void(^)(YWQrcodeRequestStatu requestStatu))complete;

/**
 *  上传扫描二维码日志
 *
 *  @param qrcodeId    二维码Id
 *  @param qrcodeLogType 操作类型
 *
 *  @return 无
 */
- (void)postQrcodeLogWithQrcodeId:(NSString*)qrcodeId qrcodeLogType:(YWQrcodeLogType)qrcodeLogType;
@end
